Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API for ParsCit #7

Merged
merged 10 commits into from
Sep 17, 2018
Merged

REST API for ParsCit #7

merged 10 commits into from
Sep 17, 2018

Conversation

kylase
Copy link

@kylase kylase commented Sep 15, 2018

REST API Implementation

  • /parscit/parse for single string
  • /parscit/parse/batch for multiple strings

Swagger-based documentation available on /docs

Local Test Results

=========================== test session starts ============================
platform darwin -- Python 2.7.15, pytest-3.5.1, py-1.5.4, pluggy-0.6.0
rootdir: /Users/yuanchuan/Documents/repo/Neural-ParsCit, inifile:
plugins: flask-0.10.0
collected 9 items

tests/test_api.py ....                                               [ 44%]
tests/test_swagger.py ..                                             [ 66%]
tests/models/test_inference.py .                                     [ 77%]
tests/models/test_load_word_embedding.py ..                          [100%]

======================== 9 passed in 215.93 seconds ========================

Copy link

@animeshprasad animeshprasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylase For batch processing the batch can be a big list of citations, in that case, we might want to write to a local file rather than return a response (or have it as a parameter in same endpoint)

@animeshprasad animeshprasad merged commit 0996021 into WING-NUS:master Sep 17, 2018
@kylase
Copy link
Author

kylase commented Sep 18, 2018

@animeshprasad thanks for the feedback.

Users/Applications which interact with REST API mostly won't require file as an output.

If they require a file, it can be easily done with command line such as curl -d '{"string": [...]}' -H "Content-Type: application/json" -X POST http://localhost:8000/parscit/parse/batch > output.json

We can have a simple front-end in the future when we have successfully port to PyTorch.

@kylase kylase deleted the feature/api branch September 19, 2018 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants